package hngc.com;

import java.util.Scanner;

public class Box2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = 0;
        int m = 0;
        System.out.println("请输入x的值:");
        while (scanner.hasNext()) {
            try {
                x = scanner.nextInt();
                System.out.println("请输入m的值:");
                m = scanner.nextInt();
                break;
            } catch (Exception e) {
                System.out.println("输入不符合要求");
                return;
            }
        }
        if ((x >= 0 && x < 5) && (m > 0 && m < 4)) {
            System.out.println("测试为算式一，值为：" + m * x + Math.pow(Math.E, x));
        } else if ((x >= 5 && x <= 10) && (m >= 4 && m < 8)) {
            System.out.println("测试为算式二，值为：" + 2 * Math.sqrt(x / m));
        } else if ((x > 10 && m >= 8)) {
            System.out.println("测试为算式三，值为" + Math.pow(x, m + 4));
        } else {
            System.out.println("输入不符合要求");
        }
        scanner.close();
    }
}
